package com.lkd.feign.fallback;

import com.lkd.feign.VmServiceFeignClient;
import com.lkd.vo.ChannelVO;
import com.lkd.vo.SkuVO;
import com.lkd.vo.VmVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class VmServiceFallbackFactory implements FallbackFactory<VmServiceFeignClient> {
    @Override
    public VmServiceFeignClient create(Throwable throwable) {
        log.error("throwable={}",throwable);
        return new VmServiceFeignClient() {
            @Override
            public VmVO getvmInfoByInnerCode(String innerCode) {
                return null;
            }

            @Override
            public List<SkuVO> getSkuListByInnerCode(String innerCode) {
                return null;
            }

            @Override
            public ChannelVO hasCapacity(String innerCode, Long skuId) {
                return null;
            }
        };
    }
}
